package com.redsea.rsadmin.common.enums;

public class CommonEnums {

	public static enum UserStatus {
		VALID(1,"有效"),
		UNVALID(0,"无效");
		
		private int value;
		
		private String name;
		
		UserStatus(Integer value,String name) {
			this.value=value;
			this.name=name;
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
		
		public String getNameOfIndex(Integer value) {
			for(UserStatus obj:this.values()) {
				if(obj.getValue() == value) {
					return obj.getName();
				}
			}
			return null;
		}
	}
}
